<center>

<script language="javascript">

	var teamid = {$current->teamid};
	
	function validatePref() {ldelim}
		
		var t = document.getElementById('team');
		var f = document.getElementById('reg_form');
		
		if (t.value!=teamid) {ldelim}
			var r=confirm("{$lang.userprefteamchange}");
			if (r==true) {ldelim}
				f.submit();
			{rdelim} else {ldelim}
				t.value = teamid;
			{rdelim}	
		{rdelim} else {ldelim}
			f.submit();
		{rdelim}
		
	{rdelim}
	
</script>

<form method="post" id="reg_form" class="box_form">
 <input type="hidden" name="flowid" id="flowid" value="{$flowid}">
 <input type="hidden" name="action" value="userpref">
 <input type="hidden" name="op" value="submit">
 <table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td>{$lang.mail}</td>
   	<td><input type="text" size="50" maxlength="50" name="mail" id="mail" class="txt" value="{$current->mail}"></td>
   </tr>
	{if $current->groupid neq 'ADMIN'}
		<tr>
			<td>{$lang.team}</td>
	   	<td>
			<select name="team" id="team" class="txt">
			{foreach from=$teamlist item=op}
				<option value="{$op->id}" {if $op->id eq $current->teamid} selected {/if}>{$op->name}</option>
			{/foreach}
		</select>
	   </tr>
	{else}
		<input type="hidden" name="team" id="team" value="{$current->teamid}">
	{/if}
	<tr>
		<td>{$lang.userlanguage}</td>
   	<td>
			<select name="lang" id="lang" class="txt">
				{foreach from=$langlist item=op}
					<option value="{$op.value}" {if $op.value eq $current->lang} selected {/if}>{$op.name}</option>
				{/foreach}
			</select>
		</td>
   </tr>
	<tr>
		<td>{$lang.timezone}</td>
   		<td>
			<select name="timezone" id="timezone" class="txt">
				{foreach from=$timezonelist item=op}
						<option value="{$op.value}" {if $op.value eq $current->timezone} selected {/if}>{$op.name}</option>
				{/foreach}
			</select>
		</td>
   </tr>
{* MAIL PREFERENCES *}
{if $CURRENT_USER->groupid neq 'ADMIN'}
	<tr>
		<td>{$lang.allowmp}</td>
   		<td>
   			<input type="checkbox" class="txt" name="allowmp" id="allowmp" value="true" {if $current->allowUserEmail() eq 'true'} checked {/if} />
		</td>
   </tr>
	<tr>
		<td>{$lang.mponchange}</td>
   		<td>
   			<input type="checkbox" class="txt" name="mponchange" id="mponchange" value="true" {if $current->notifyOnChange() eq 'true'} checked {/if} />
		</td>
   </tr>
	<tr>
		<td>{$lang.mptask}</td>
   		<td>
   			<input type="checkbox" class="txt" name="mptask" id="mptask" value="true" {if $current->notifyTask() eq 'true'} checked {/if} />
		</td>
   </tr>
  {*
	<tr>
		<td>{$lang.commitright}</td>
   		<td>
			<select name="cancommit" id="cancommit" class="txt">
				<option value="false">{$lang.no}</option>
				<option value="true" {if $current->commitRights() eq 'true'} selected {/if}>{$lang.yes}</option>
			</select>
		</td>
   </tr>
*}
{/if}   
	<tr>
		<td>{$lang.group}</td>
   		<td>
   		{eval var=$current->groupid assign="grid"}
   		<b>{$lang.$grid}</b>
   		<!-- <input type="text" class="txt" value="{$lang.$grid}" readonly>-->
		</td>
   </tr>   
   
   <tr>
   	<td>&nbsp;</td>
	 	<td align="right">{include file="button.tpl" name=$lang.ok action="validatePref()"}</td>
   </tr>
 </table>
</form>

</center>